home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / os2 / fbimon.zip / EmxRexx / RexxEx.cmd < prev   
OS/2 REXX Batch file  |  1997-05-22  |  2KB  |  98 lines

  1. /* Teste FBiMon.dll */
  2. rc=RxFuncAdd("SysLoadFuncs","REXXUTIL","SysLoadFuncs")
  3. call SysLoadFuncs
  4. rc=RxFuncAdd("FBiMonLoadAll","FBIMON","FBiMonLoadAll")
  5. call FBiMonLoadAll
  6.  
  7. signal on halt name sortie
  8.  
  9. do while 1=1
  10.    call FBiMonCls
  11.    call FBiMonCursor 0,0,1
  12.    /* Affiche les informations sur les disques */
  13.    row=1
  14.    lecteurliste="C D F G H I J K"
  15.    do i=1 to 8
  16.       lecteur=subword(lecteurliste,i,1)
  17.       lectinfo=SysDriveInfo(lecteur":")
  18.       if (lectinfo <> '') then do
  19.          total=subword(lectinfo,3,1)
  20.          libre=subword(lectinfo,2,1)
  21.          call affichejauge 18,row,40,total,total-libre
  22.          rc=FBiMonStrAt(lecteur,2,row+1,15)
  23.          rc=FBiMonStrAt(amount(libre),2,row+1,60)
  24.          row=row+3
  25.       end
  26.    end /* do */
  27.    call FBiMonSleep 10000
  28.    call FBiMonCls
  29.    call FBiMonCursor 0,0,1
  30.  
  31.    /* Affiche l'heure */
  32.    call affichedate
  33.    do 10
  34.       call afficheheure
  35.       call FBiMonSleep 900
  36.    end /* do */
  37. end /* do */
  38.  
  39. exit
  40.  
  41. /* affichejauge x,y,l,max,valeur */
  42. affichejauge:
  43.    x=arg(1); y=arg(2); l=arg(3); lmax=arg(4); valeur=arg(5)
  44.    nb=trunc((valeur/lmax)*(l-2))
  45.    rc=FBiMonCadre(15,x,y,l,3);
  46.    rc=FBiMonStrAt(copies("█",nb)copies("░",l-2-nb),2,y+1,x+1);
  47. return
  48.  
  49. /* Retourne l'argument écrit en Ko Mo ou Go */
  50. amount: procedure
  51.    valeur=arg(1)
  52.    nb=1
  53.    do while valeur > 1024
  54.       valeur=valeur/1024
  55.       nb=nb+1
  56.    end /* do */
  57. return trunc(valeur,1)" "subword("b Kb Mb Gb Tb",nb,1)
  58.  
  59. /* Affiche la date en cours en gros */
  60. affichedate: procedure
  61.    ladate=date('E')
  62.    ch.1=substr(ladate,1,1)
  63.    ch.2=substr(ladate,2,1);
  64.    ch.3=':'
  65.    ch.4=substr(ladate,4,1);
  66.    ch.5=substr(ladate,5,1);
  67.    col=12
  68.    do i=1 to 5
  69.       col=col+FBiMonChiffre(ch.i,2,col,1);
  70.    end /* do */
  71. return
  72.  
  73. /* Affiche l'heure en cours en gros */
  74. afficheheure: procedure
  75.    heure=time()
  76.    ch.1=substr(heure,1,1)
  77.    ch.2=substr(heure,2,1);
  78.    ch.3=":"
  79.    ch.4=substr(heure,4,1);
  80.    ch.5=substr(heure,5,1);
  81.    ch.6=":"
  82.    ch.7=substr(heure,7,1);
  83.    ch.8=substr(heure,8,1);
  84.    col=0
  85.    do i=1 to 8
  86.       col=col+FBiMonChiffre(ch.i,2,col,12);
  87.    end /* do */
  88.    if (80 >= col) then
  89.       do row=12 to 17
  90.          rc=FBiMonStrAt(copies(" ",80-col),0,row,col)
  91.       end /* do */
  92.    
  93. return
  94.  
  95. sortie:
  96.    call FBiMonCls
  97.    exit
  98.